Skip to content

validation added to NumericalInput to just accept numerical values on block creation form#2615

Merged
bradenmacdonald merged 10 commits intoopenedx:masterfrom
WGU-Open-edX:OEXCOM-245/AUTH-BLOCK-FORM-VALIDATION
Dec 19, 2025
Merged

validation added to NumericalInput to just accept numerical values on block creation form#2615
bradenmacdonald merged 10 commits intoopenedx:masterfrom
WGU-Open-edX:OEXCOM-245/AUTH-BLOCK-FORM-VALIDATION

Conversation

@jesusbalderramawgu
Copy link
Copy Markdown
Contributor

@jesusbalderramawgu jesusbalderramawgu commented Nov 11, 2025

Description

There's a bug with Numerical Input Component which Incorrectly Handles Formulas as numericalresponse.
after some research and talking with the community we agreed to validate the author block form to just accept numeric values in the answers.

this is how the form will show the error if the value is not numeric.

Screenshot 2025-11-11 at 11 43 47 a m it closes [#1680]

Testing instructions

First you need to use edx-platform with this branch OEXCOM-245/numericalinput-validation

  • Create or select in Studio
  • Create a section inside the course
  • Create a subsection inside the secion
  • Click on "New unit" button inside the subsection
Screenshot 2025-12-16 at 4 07 59 p m

Then you will be redirected to this view
Screenshot 2025-12-16 at 4 10 12 p m

Select the "Problem" button, then a modal will pop up and finally select the "Numerical input" option.

scroll down in the modal and you will see a block called "Answers"

Screenshot 2025-12-16 at 4 10 39 p m

In that input is where you can add the numerical input and see the response from the API.

Valid formula
Screenshot 2025-12-16 at 4 13 40 p m

Invalid formula

Screenshot 2025-12-16 at 4 14 38 p m

@openedx-webhooks openedx-webhooks added the open-source-contribution PR author is not from Axim or 2U label Nov 11, 2025
@openedx-webhooks
Copy link
Copy Markdown

Thanks for the pull request, @jesusbalderramawgu!

This repository is currently maintained by @bradenmacdonald.

Once you've gone through the following steps feel free to tag them in a comment and let them know that your changes are ready for engineering review.

🔘 Get product approval

If you haven't already, check this list to see if your contribution needs to go through the product review process.

  • If it does, you'll need to submit a product proposal for your contribution, and have it reviewed by the Product Working Group.
    • This process (including the steps you'll need to take) is documented here.
  • If it doesn't, simply proceed with the next step.
🔘 Provide context

To help your reviewers and other members of the community understand the purpose and larger context of your changes, feel free to add as much of the following information to the PR description as you can:

  • Dependencies

    This PR must be merged before / after / at the same time as ...

  • Blockers

    This PR is waiting for OEP-1234 to be accepted.

  • Timeline information

    This PR must be merged by XX date because ...

  • Partner information

    This is for a course on edx.org.

  • Supporting documentation
  • Relevant Open edX discussion forum threads
🔘 Get a green build

If one or more checks are failing, continue working on your changes until this is no longer the case and your build turns green.

Details
Where can I find more information?

If you'd like to get more details on all aspects of the review process for open source pull requests (OSPRs), check out the following resources:

When can I expect my changes to be merged?

Our goal is to get community contributions seen and reviewed as efficiently as possible.

However, the amount of time that it takes to review and merge a PR can vary significantly based on factors such as:

  • The size and impact of the changes that it introduces
  • The need for product review
  • Maintenance status of the parent repository

💡 As a result it may take up to several weeks or months to complete a review and merge your PR.

@diana-villalvazo-wgu
Copy link
Copy Markdown
Contributor

Suggestion: In the description of the PR you can add Fixes #{PR number} or Closes #{PR number} so when this PR is merged the Github issue will be closed automatically

@diana-villalvazo-wgu diana-villalvazo-wgu added the mao-onboarding Reviewing this will help onboard devs from an Axim mission-aligned organization (MAO). label Nov 11, 2025
@diana-villalvazo-wgu diana-villalvazo-wgu moved this from Needs Triage to Ready for Review in Contributions Nov 11, 2025
@jacobo-dominguez-wgu
Copy link
Copy Markdown
Contributor

You need to follow the conventional commits messages

@bradenmacdonald
Copy link
Copy Markdown
Contributor

Thanks! Let me know once the other reviewers have approved it, or if you need me to approve some more test runs.

Copy link
Copy Markdown
Member

@kdmccormick kdmccormick left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for your work so far @jesusbalderramawgu !

Comment thread src/editors/containers/ProblemEditor/data/OLXParser.js Outdated
@mphilbrick211 mphilbrick211 moved this from Ready for Review to In Eng Review in Contributions Nov 13, 2025
@codecov
Copy link
Copy Markdown

codecov Bot commented Nov 14, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 94.92%. Comparing base (36c9eba) to head (696bb7f).
⚠️ Report is 78 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #2615      +/-   ##
==========================================
+ Coverage   94.81%   94.92%   +0.11%     
==========================================
  Files        1225     1239      +14     
  Lines       27481    28448     +967     
  Branches     6187     6296     +109     
==========================================
+ Hits        26056    27005     +949     
- Misses       1367     1385      +18     
  Partials       58       58              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@jesusbalderramawgu jesusbalderramawgu force-pushed the OEXCOM-245/AUTH-BLOCK-FORM-VALIDATION branch from 842e6a2 to 14d2c72 Compare November 15, 2025 00:15
@jesusbalderramawgu
Copy link
Copy Markdown
Contributor Author

You need to follow the conventional commits messages

thanks, I made the change in the current commit messages and I'll keep this in mind for future PR

Comment thread src/editors/data/redux/thunkActions/requests.js Outdated
@kdmccormick kdmccormick self-requested a review November 24, 2025 20:12
@bradenmacdonald
Copy link
Copy Markdown
Contributor

I believe this is blocked on openedx/openedx-platform#37677

@bradenmacdonald bradenmacdonald moved this from In Eng Review to Blocked in Contributions Dec 10, 2025
@mphilbrick211 mphilbrick211 moved this from Blocked to In Eng Review in Contributions Dec 12, 2025
@kdmccormick
Copy link
Copy Markdown
Member

@bradenmacdonald The linked edx-platform PR is unblocked now, would you like to review this or should I?

@bradenmacdonald
Copy link
Copy Markdown
Contributor

@kdmccormick I can review.

Comment thread src/editors/containers/ProblemEditor/data/apiHooks.ts
Comment thread src/editors/containers/ProblemEditor/data/apiHooks.ts Outdated
)}
{isPending && (
<Spinner animation="border" className="mie-3 mt-3" screenReaderText="loading" />
)}
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why did you remove the spinner?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

because I realized it wasn't necessary, none of the forms have it. Also it was causing a bouncing in the modal on typing.

@bradenmacdonald
Copy link
Copy Markdown
Contributor

Please get the coverage test passing again and then I can approve and merge.

@kdmccormick kdmccormick removed their request for review December 18, 2025 21:23
@kdmccormick kdmccormick dismissed their stale review December 18, 2025 21:24

braden's review is sufficient

@jesusbalderramawgu
Copy link
Copy Markdown
Contributor Author

Please get the coverage test passing again and then I can approve and merge.
I fixed the coverage test, Thank you @bradenmacdonald!

@bradenmacdonald bradenmacdonald merged commit 9072bb6 into openedx:master Dec 19, 2025
7 checks passed
@github-project-automation github-project-automation Bot moved this from In Eng Review to Done in Contributions Dec 19, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

mao-onboarding Reviewing this will help onboard devs from an Axim mission-aligned organization (MAO). open-source-contribution PR author is not from Axim or 2U

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

8 participants